/*!
    \file    change log.txt
    \brief   change log for GD32F527 demo

    \version 2026-02-06, V1.4.0, demo for GD32F527
*/

/*
    Copyright (c) 2026, GigaDevice Semiconductor Inc.

    Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this
       list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright notice,
       this list of conditions and the following disclaimer in the documentation
       and/or other materials provided with the distribution.
    3. Neither the name of the copyright holder nor the names of its contributors
       may be used to endorse or promote products derived from this software without
       specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/

******************* V1.4.0 2025-02-06 ************************************************************************************
______________________Common______________________________________________________________________________________________
../GD32F527_Demo_Suites/GD32F527R_START_Demo_Suites/Projects

fix reason:
GD32EmbeddedBuilder development environment added

V1.3.0:
None 
V1.4.0:
New added.

******************* V1.3.0 2025-08-08 ************************************************************************************
______________________Common______________________________________________________________________________________________
Fix file:
..\GD32F527_Demo_Suites\GD32F527_Firmware_Library
fix reason:
Updated the firmware library to the latest version V1.3.0.

______________________USB______________________________________________________________________________________________
Fix file:
../GD32F527_Demo_Suites/GD32F527R_START_Demo_Suites/Projects/06_USB_MSC_Device/src/gd32f5xx_it.c
../GD32F527_Demo_Suites/GD32F527R_START_Demo_Suites/Projects/07_USB_MSC_Host/src/gd32f5xx_it.c
../GD32F527_Demo_Suites/GD32F527R_START_Demo_Suites/Projects/07_USB_MSC_Host/MDK-ARM/startup_gd32f5xx.s

fix reason:
1. Add FPU and SRAMECC and flash single-bit error interrupt handlers, with these interrupts being enabled by default to prevent unexpected 
interrupts caused by application code and to provide user notifications.
2. Add SRAM  initialization to startup code
../GD32F527_Demo_Suites/GD32F527R_START_Demo_Suites/Projects/06_USB_MSC_Device/src/gd32f5xx_it.c
../GD32F527_Demo_Suites/GD32F527R_START_Demo_Suites/Projects/07_USB_MSC_Host/src/gd32f5xx_it.c
V1.2.0:
none
V1.3.0:
/*!
    \brief      this function handles SRAM and Flash single bit ECC non-correction exception
    \param[in]  none
    \param[out] none
    \retval     none
*/
void SYSCFG_SINGLE_BIT_ECC_ER_IRQHandler(void)
{
    if((SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE0)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE1)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE2)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE3)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE4)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE5)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE6))) {
        MULTI_ECC_ERROR_HANDLE("SRAM or FLASH single bit ECC error\r\n");
    }
}

/*!
    \brief      this function handles FPU exception
    \param[in]  none
    \param[out] none
    \retval     none
*/
void FPU_IRQHandler(void)
{
    /* if FPU exception occurs, go to infinite loop */
    while(1) {
    }
}

../GD32F527_Demo_Suites/GD32F527R_START_Demo_Suites/Projects/07_USB_MSC_Host/MDK-ARM/startup_gd32f5xx.s
V1.2.0:
Reset_Handler   PROC
                EXPORT  Reset_Handler                     [WEAK]
                IMPORT  SystemInit
                IMPORT  __main
                IMPORT |Image$$RW_IRAM1$$RW$$Base|

                LDR     R0, =|Image$$RW_IRAM1$$RW$$Base|
                ADD     R1, R0, #0x8000
                LDR     R2, =0x0
MEM_INIT        STRD    R2, R2, [ R0 ] , #8
                CMP     R0, R1
                BNE     MEM_INIT
V1.3.0:
Reset_Handler   PROC
                EXPORT  Reset_Handler                     [WEAK]

                LDR     R0, =0x10000000
                MOV     R1, #64
                LSL     R1, R1, #10
                MOV     R2, #0x00
TCMSRAM_INIT    STM     R0!, {R2}
                SUBS    R1, R1, #4
                CMP     R1, #0x00
                BNE     TCMSRAM_INIT

                LDR     R0, =0x1FFF7A20
                LDR     R2, [R0]
                SUBS    R2, R2, #64
                LDR     R0, = 0x0000FFFF
                AND     R2, R2, R0
                LSL     R2, R2, #10
                LDR     R1, =0x20000000
                MOV     R0, #0x00
SRAM_INIT       STM     R1!, {R0}
                SUBS    R2, R2, #4
                CMP     R2, #0x00
                BNE     SRAM_INIT

******************* V1.2.0 2024-12-27 ************************************************************************************
______________________Common______________________________________________________________________________________________
Fix file:
..\GD32F527_Demo_Suites\GD32F527_Firmware_Library
fix reason:
Updated the firmware library to the latest version V1.2.0.

******************* V1.1.0: 2024-08-02 ************************************************************************************
______________________Common______________________________________________________________________________________________
Fix file:
gd32f527_it.c in each demo's 
fix reason:
Add FPU and SRAMECC and flash single-bit error interrupt handlers, with these interrupts being enabled by default to prevent unexpected 
interrupts caused by application code and to provide user notifications.
V1.0.0:
none
V1.1.0:
/*!
    \brief      this function handles SRAM and Flash single bit ECC non-correction exception
    \param[in]  none
    \param[out] none
    \retval     none
*/
void SYSCFG_SINGLE_BIT_ECC_ER_IRQHandler(void)
{
    if((SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE0)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE1)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE2)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE3)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE4)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE5)) ||
            (SET == syscfg_interrupt_flag_get(SYSCFG_INT_FLAG_ECCSE6))) {
        MULTI_ECC_ERROR_HANDLE("SRAM or FLASH single bit ECC error\r\n");
    }
}

/*!
    \brief      this function handles FPU exception
    \param[in]  none
    \param[out] none
    \retval     none
*/
void FPU_IRQHandler(void)
{
    /* if FPU exception occurs, go to infinite loop */
    while(1) {
    }
}

Fix file:
gd32f527_it.h
fix reason:
Add the declaration of the SYSCFG_SINGLE_BIT_ECC_ER_IRQHandler and FPU_IRQHandler function. 
V1.0.0:
none
V1.1.0:
/* this function handles SRAM and Flash single bit ECC non-correction exception */
void SYSCFG_SINGLE_BIT_ECC_ER_IRQHandler(void);
/* this function handles FPU exception */
void FPU_IRQHandler(void);

Fix file:
All functions in the file that involve the use of a serial port.
fix reason:
Modify the serial port redirection function to adapt to the Embedded Builder IDE.
V1.0.0:
/* retarget the C library printf function to the USART */
int fputc(int ch, FILE *f)
{
    usart_data_transmit(EVAL_COM0, (uint8_t)ch);
    while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE));
    return ch;
}
V1.1.0:
#ifdef GD_ECLIPSE_GCC
/* retarget the C library printf function to the USART, in Eclipse GCC environment */
int __io_putchar(int ch)
{
    usart_data_transmit(EVAL_COM0, (uint8_t) ch );
    while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE));
    return ch;
}
#else
/* retarget the C library printf function to the USART */
int fputc(int ch, FILE *f)
{
    usart_data_transmit(EVAL_COM0, (uint8_t)ch);
    while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE));
    return ch;
}
#endif /* GD_ECLIPSE_GCC */
__________________________________________________________________________________________________________________________
